import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import test from '../views/test.vue'
import BlogDetail from "../views/BlogDetail";
import About from "../views/About";
import Archived from "../views/Archived";
// import Page404 from "../views/Page404";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/test',
    name: 'test',
    component: test
  },
  {
    path: '/BlogDetail',
    name: 'BlogDetail',
    component: BlogDetail
  },
  {
    path: '/about',
    name: 'About',
    component: About
  },
  {
    path: '/archived',
    name: 'Archived',
    component: Archived
  },
  {
    path:'/login',
    name: 'login',
    component: ()=>import('../views/login')
  },
  {
    path: '*',
    name: 'Page404',
    component: () => import('../views/Page404.vue')
  }
]

const router = new VueRouter({
  routes
})
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)

}

export default router
